from selenium.webdriver.common.by import By

class Login():

    def __init__(self, driver):
        self.driver = driver

    def login(self, username, password):
        # 输入用户名
        self.driver.find_element(By.ID, "username").send_keys(username)
        # 输入密码
        self.driver.find_element(By.ID, "password").send_keys(password)
        # 点击登入
        self.driver.find_element(By.ID, "login_btn").click()


